package com.sphd.emanu.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sphd.emanu.R;
import com.sphd.emanu.pojo.market.Deposit;
import com.wzutils.BigDisMailUtils;

import java.util.List;

/**
 * @Author Hu
 * @Time 2017/6/20 --17:18.
 * @Email 87683202@qq.com
 */
public class TopupServiceAdapter extends BaseQuickAdapter<Deposit,BaseViewHolder> {
    boolean isCanDo;
    public TopupServiceAdapter(@LayoutRes int layoutResId, @Nullable List<Deposit> data, boolean isCanDo) {
        super(layoutResId, data);
        this.isCanDo=isCanDo;
    }

    @Override
    protected void convert(BaseViewHolder helper, Deposit item) {
            helper.setText(R.id.item_category,"缴费"+BigDisMailUtils.subZeroAndDot(item.getThreshold().toString())+"充值"+
                    BigDisMailUtils.subZeroAndDot(item.getAmount().toString()))
                    .setVisible(R.id.item_edit,isCanDo)
                    .addOnClickListener(R.id.item_edit);
    }
}
